Stefan Monnier [Wed, 10 Feb 2021 21:39:53 +0000 (16:39 -0500)]
* lisp/subr.el (combine-change-calls-1): Don't presume integer args
This avoids problems where the `after-change-functions` end up called
with the new length rather than the old length.
Stefan Monnier [Wed, 10 Feb 2021 21:06:24 +0000 (16:06 -0500)]
* lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Break cycles
* test/lisp/emacs-lisp/macroexp-tests.el: New file.
Juri Linkov [Wed, 10 Feb 2021 19:37:47 +0000 (21:37 +0200)]
Fix ediff even/odd faces to increase their contrast and readability
* lisp/vc/ediff-init.el (ediff-even-diff-A, ediff-even-diff-B)
(ediff-even-diff-C, ediff-even-diff-Ancestor, ediff-odd-diff-A)
(ediff-odd-diff-B, ediff-odd-diff-C): Add :distant-foreground
"Black" for light background. For dark background
add :distant-foreground "White", and use darker shades of grey
for background colors (bug#46396).
Lars Ingebrigtsen [Wed, 10 Feb 2021 19:37:10 +0000 (20:37 +0100)]
Fix build problem with previous facemenu change
* lisp/facemenu.el (facemenu-add-face-function): Move to avoid a
warning.
(list-colors-display): Autoload.
Paul Eggert [Wed, 10 Feb 2021 18:55:42 +0000 (10:55 -0800)]
Simplify and speed up after-find-file
Use newer primitives like file-accessible-directory-p to simplify
and speed up longstanding code in after-find-file.
* lisp/files.el (after-find-file):
Prefer file-exists-p + file-symlink-p to file-attributes +
file-symlink-p + file-chase-links + file-exists-p.
Prefer file-accessible-directory-p to directory-file-name +
file-attributes.
Prefer file-directory-p to file-name-directory + file-exists-p.
Paul Eggert [Wed, 10 Feb 2021 18:50:44 +0000 (10:50 -0800)]
Fix file lock issue (Bug#46397)
* src/filelock.c (current_lock_owner):
Also treat ENOTDIR as meaning the lock file does not exist.
Lars Ingebrigtsen [Wed, 10 Feb 2021 18:38:10 +0000 (19:38 +0100)]
Remove the 'M-o' ('facemap-keymap') binding experimentally
* doc/lispref/maps.texi (Standard Keymaps):
* doc/lispref/keymaps.texi (Prefix Keys): Remove mentions.
* etc/facemenu-removal.txt: New temporary file.
* lisp/loadup.el: Don't load facemenu.el.
(removed-facemenu-command): New command.
(facemenu-keymap-restore): New function.
* lisp/textmodes/text-mode.el (center-paragraph): Remove binding.
(center-line): Remove binding.
Stefan Monnier [Wed, 10 Feb 2021 18:12:09 +0000 (13:12 -0500)]
* lisp/emacs-lisp/edebug.el: Tweak last change
Use generic functions i.s.o `edebug--spec-op-function`.
<toplevel>: No need to register the &foo and :foo handler any more.
(edebug--handle-&-spec-op, edebug--handle-:-spec-op): New generic functions.
(edebug-match-specs): Use them.
(edebug--get-spec-op): Remove function.
(edebug-match-&optional, edebug-match-&rest, edebug-match-&or)
(edebug-match-¬, edebug-match-&key, edebug-match-&error)
(edebug-match-&define): Turn functions into methods of
`edebug--handle-&-spec-op`.
(edebug-match-:name, edebug-match-:unique): Turn functions into methods of
`edebug--handle-:-spec-op`.
Stefan Kangas [Wed, 10 Feb 2021 17:42:52 +0000 (18:42 +0100)]
Use lexical-binding in dns-mode.el
* lisp/textmodes/dns-mode.el: Use lexical-binding. Remove
redundant :group args.
* test/lisp/textmodes/dns-mode-tests.el
(dns-mode-tests-dns-mode-soa-increment-serial): New test.
Stefan Kangas [Wed, 10 Feb 2021 16:31:17 +0000 (17:31 +0100)]
Use lexical-binding in mail-utils.el and add tests
* lisp/mail/mail-utils.el: Use lexical-binding.
* test/lisp/mail/mail-utils-tests.el: New file.
Stefan Monnier [Wed, 10 Feb 2021 17:36:36 +0000 (12:36 -0500)]
* list/emacs-lisp/edebug.el: Don't overload `edebug-form-spec`
The `edebug-form-spec` symbol property was used to store two different things:
the handlers for spec elements like `body` and the handlers for
spec operators like `&or`. But these two sets use different calling
conventions, so they're fundamentally incompatible.
So, move the handlers to spec operators to the new property
`edebug--spec-op-function`. This unbreaks Edebugging of:
(cl-flet ((f (&rest x) x)) 3)
* lisp/emacs-lisp/edebug.el <toplevel>: Split the alist of built in
spec elements into normal spec element and spec ops.
(edebug--get-spec-op): New function.
(edebug-match-specs): Use it.
(edebug-match-:name): Rename from `edebug-match-colon-name`.
Eli Zaretskii [Wed, 10 Feb 2021 16:10:17 +0000 (18:10 +0200)]
Bump FACE_CACHE_BUCKETS_SIZE to 1009
* src/xfaces.c (FACE_CACHE_BUCKETS_SIZE): Make it 1009, a prime
number, per the comment. Reported by Win Treese <treese@acm.org>.
Mattias Engdegård [Wed, 10 Feb 2021 13:26:49 +0000 (14:26 +0100)]
Fix local defvar scoping error (bug#46387)
This bug was introduced by the lexical variable constant propagation
mechanism. It was discovered by Michael Heerdegen.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form)
(byte-optimize-body): Let the effects of a local defvar declaration be
scoped by let and let*, not any arbitrary Lisp expression body (such
as progn).
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--get-vars)
(bytecomp-local-defvar): New test.
Stefan Kangas [Wed, 10 Feb 2021 13:10:10 +0000 (14:10 +0100)]
Minor cleanup in imenu.el
* lisp/imenu.el: Doc fix; these examples have been removed. Remove
redundant :group args.
Stefan Kangas [Wed, 10 Feb 2021 13:08:01 +0000 (14:08 +0100)]
Use lexical-binding in snmp-mode.el
* lisp/net/snmp-mode.el: Use lexical-binding. Remove redundant :group
args. Doc fix; remove outdated information.
(snmp-mode, snmpv2-mode): Add FIXME to use define-derived-mode.
Stefan Kangas [Wed, 10 Feb 2021 12:59:09 +0000 (13:59 +0100)]
Declare empty macro imenu-progress-menu obsolete
* lisp/imenu.el: Remove commented out code.
(imenu-progress-message): Declare macro obsolete.
* lisp/erc/erc-imenu.el (erc-create-imenu-index):
* lisp/net/snmp-mode.el (snmp-mode-imenu-create-index):
* lisp/progmodes/antlr-mode.el (antlr-imenu-create-index-function):
Don't use or mention above obsolete macro.
Protesilaos Stavrou [Wed, 10 Feb 2021 04:03:33 +0000 (06:03 +0200)]
Update NEWS entry for vc-dir faces
* NEWS: Remove reference to specific backend, as it now applies to all
of them. Update name of 'vc-dir-status-ignored'.
This follows from the discussion in bug#46358.
Stefan Kangas [Wed, 10 Feb 2021 12:21:34 +0000 (13:21 +0100)]
* lisp/cedet/semantic/bovine/gcc.el: Use lexical-binding.
Stefan Kangas [Wed, 10 Feb 2021 11:44:07 +0000 (12:44 +0100)]
Move cedet test resource files to follow our conventions
* test/lisp/cedet/semantic-utest-ia.el (ert, ert-x): Require.
(cedet-utest-directory, semantic-utest-test-directory): Remove
variables.
(semantic-utest-ia-doublens.cpp, semantic-utest-ia-subclass.cpp)
(semantic-utest-ia-typedefs.cpp, semantic-utest-ia-struct.cpp)
(semantic-utest-ia-templates.cpp, semantic-utest-ia-using.cpp)
(semantic-utest-ia-nsp.cpp, semantic-utest-ia-localvars.cpp)
(semantic-utest-ia-namespace.cpp)
(semantic-utest-ia-sppcomplete.c, semantic-utest-ia-varnames.c)
(semantic-utest-ia-javacomp.java)
(semantic-utest-ia-varnames.java, semantic-utest-ia-wisent.wy)
(semantic-utest-ia-texi, semantic-utest-ia-make)
(semantic-utest-ia-srecoder): Use 'ert-resource-file'. Don't
check if file exists; we can assume that it does.
* test/manual/cedet/tests/testjavacomp.java:
* test/manual/cedet/tests/testlocalvars.cpp:
* test/manual/cedet/tests/testnsp.cpp:
* test/manual/cedet/tests/testsppcomplete.c:
* test/manual/cedet/tests/teststruct.cpp:
* test/manual/cedet/tests/testsubclass.cpp:
* test/manual/cedet/tests/testsubclass.hh:
* test/manual/cedet/tests/testtemplates.cpp:
* test/manual/cedet/tests/testtypedefs.cpp:
* test/manual/cedet/tests/testusing.cpp:
* test/manual/cedet/tests/testusing.hh:
* test/manual/cedet/tests/testvarnames.c:
* test/manual/cedet/tests/testvarnames.java:
* test/manual/cedet/tests/testwisent.wy: Move from here...
* test/lisp/cedet/semantic-utest-ia-resources/testjavacomp.java:
* test/lisp/cedet/semantic-utest-ia-resources/testlocalvars.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testnsp.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c:
* test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsubclass.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testsubclass.hh:
* test/lisp/cedet/semantic-utest-ia-resources/testtemplates.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testtypedefs.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testusing.cpp:
* test/lisp/cedet/semantic-utest-ia-resources/testusing.hh:
* test/lisp/cedet/semantic-utest-ia-resources/testvarnames.c:
* test/lisp/cedet/semantic-utest-ia-resources/testvarnames.java:
* test/lisp/cedet/semantic-utest-ia-resources/testwisent.wy:
...to here.
Stefan Kangas [Wed, 10 Feb 2021 11:20:32 +0000 (12:20 +0100)]
Convert tests for srecode/fields.el to ert
* test/manual/cedet/srecode-tests.el: Move from here...
* test/lisp/cedet/srecode/fields-tests.el: ...to here.
(srecode-field-utest-impl): Convert test to ert. Silence
byte-compiler.
* test/manual/cedet/cedet-utests.el (cedet-utest-libs): Don't
list the above moved file.
Stefan Kangas [Wed, 10 Feb 2021 05:40:13 +0000 (06:40 +0100)]
; * test/lisp/cedet/semantic/format-tests.el: Minor cleanup.
Stefan Kangas [Wed, 10 Feb 2021 03:48:43 +0000 (04:48 +0100)]
Make texinfmt-version variable obsolete
* lisp/textmodes/texinfmt.el (texinfmt-version): Make variable and
command obsolete in favour of 'emacs-version'.
(texinfo-format-region, texinfo-format-buffer-1): Use
'emacs-version' instead of above obsolete variable.
Stefan Kangas [Wed, 10 Feb 2021 03:42:37 +0000 (04:42 +0100)]
Use lexical-binding in bib-mode.el
* lisp/textmodes/bib-mode.el: Use lexical-binding. Remove
redundant :group args.
Stefan Kangas [Wed, 10 Feb 2021 03:14:48 +0000 (04:14 +0100)]
Move semantic/format.el tests to follow our conventions
* test/lisp/cedet/semantic-utest-fmt.el: Move from here...
* test/lisp/cedet/semantic/format-tests.el: ...to here.
(ert, ert-x): Require.
(semantic-fmt-utest-file-list): Use ert-resource-file.
* test/manual/cedet/tests/test-fmt.cpp:
* test/manual/cedet/tests/test-fmt.el: Move from here...
* test/lisp/cedet/semantic/format-resources/test-fmt.cpp:
* test/lisp/cedet/semantic/format-resources/test-fmt.el: ...to here.
Stefan Kangas [Wed, 10 Feb 2021 02:06:27 +0000 (03:06 +0100)]
Use lexical-binding in some test files
* test/manual/cedet/ede-tests.el:
* test/manual/cedet/srecode-tests.el:
* test/manual/cedet/tests/test.el: Use lexical-binding.
* test/manual/etags/el-src/TAGTEST.EL: Add lexical-binding cookie.
* test/manual/etags/ETAGS.good_1: Update expected result for the
above change.
Stefan Kangas [Wed, 10 Feb 2021 02:02:03 +0000 (03:02 +0100)]
Change default semantic-lex-analyzer to semantic-lex
* lisp/cedet/semantic/lex.el (semantic-lex-analyzer): Change default
to semantic-lex, since semantic-flex was obsolete and has been
removed.
Stefan Kangas [Wed, 10 Feb 2021 01:07:55 +0000 (02:07 +0100)]
Convert many manual cedet tests to ert
* test/manual/cedet/cedet-utests.el
(cedet-files-utest): Move test from here...
* test/lisp/cedet/cedet-files-tests.el: ...to this new file.
* test/manual/cedet/srecode-tests.el
(srecode-document-function-comment-extract-test): Move test from
here...
* test/lisp/cedet/srecode/document-tests.el: ...to this new file.
* test/manual/cedet/cedet-utests.el
(inversion-unit-test): Move test from here...
* test/lisp/cedet/inversion-tests.el: ...to this new file.
* test/manual/cedet/semantic-tests.el
(semantic-gcc-test-output-parser): Move test from here...
* test/lisp/cedet/semantic/bovine/gcc-tests.el: ...to this new file.
* test/manual/cedet/semantic-tests.el
(semantic-test-data-cache): Move test from here...
* test/lisp/cedet/semantic/fw-tests.el: ...to this new file.
Stefan Kangas [Wed, 10 Feb 2021 00:23:41 +0000 (01:23 +0100)]
Use lexical-binding in almost all of play/*.el
* lisp/play/5x5.el: Use lexical-binding.
(5x5-draw-grid-end, 5x5-draw-grid, 5x5-solver)
(5x5-solve-suggest): Silence byte-compiler.
* lisp/play/cookie1.el: Use lexical-binding.
(cookie-shuffle-vector, cookie-apropos): Silence byte-compiler.
* lisp/play/zone.el: Use lexical-binding.
(zone): Convert lambda to proper lexical closure.
(zone-replace-char, zone-fill-out-screen): Silence byte-compiler.
* lisp/play/blackbox.el:
* lisp/play/doctor.el:
* lisp/play/gametree.el:
* lisp/play/hanoi.el: Use lexical-binding.
* test/lisp/play/cookie1-resources/cookies:
* test/lisp/play/cookie1-tests.el: New files.
Protesilaos Stavrou [Tue, 9 Feb 2021 04:49:05 +0000 (06:49 +0200)]
Refine use of vc-dir faces; apply to all backends
* lisp/vc/vc-dir.el (vc-default-dir-printer): Add check for the
"ignored" status and make 'vc-dir-status-edited' the default face.
Also extend condition for more states that qualify as "warnings".
(vc-dir-ignored, vc-dir-status-ignored): Rename face for consistency.
* lisp/vc/vc-git.el (vc-git-dir-printer): Use the
'vc-dir-status-edited' as the default for the Git backend. And
reference the renamed face. Also stop treating the empty stash
differently from other header values.
* lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Implement new faces.
* lisp/vc/vc-cvs.el (vc-cvs-dir-extra-headers): Same.
* lisp/vc/vc-hg.el (vc-hg-dir-extra-headers): Same.
* lisp/vc/vc-svn.el (vc-svn-dir-extra-headers): Same.
This follows from the discussion in bug#46358.
Basil L. Contovounesios [Tue, 9 Feb 2021 19:04:58 +0000 (19:04 +0000)]
; Fix warning in last change to semantic/idle.el.
Basil L. Contovounesios [Tue, 9 Feb 2021 18:59:24 +0000 (18:59 +0000)]
Tiny simplification to read-char-by-name
* lisp/international/mule-cmds.el (mule--ucs-names-sort-by-code):
Sort with car-less-than-car instead of slower lambda.
(mule--ucs-names-affixation): Just stick character into a list to
avoid trip through format and char-to-string.
(read-char-by-name): Quote function symbols as such.
Eli Zaretskii [Tue, 9 Feb 2021 18:57:29 +0000 (20:57 +0200)]
Fix syntax category of some characters
* lisp/international/characters.el (modify-syntax-entry): Fix
syntax of numerical subscripts and superscripts. (Bug#46240)
Juri Linkov [Tue, 9 Feb 2021 18:29:54 +0000 (20:29 +0200)]
* lisp/net/dictionary.el: Dictionary improvements (bug#45262)
* lisp/net/dictionary.el (dictionary-link-dictionary): New defcustom.
(dictionary-mark-reference): Use dictionary-link-dictionary.
(dictionary-post-buffer-hook): New defcustom.
(dictionary-post-buffer): Run dictionary-post-buffer-hook.
(dictionary-mode-map): Bind 'S-SPC' to scroll-down-command.
(dictionary-search-default): Use possibly multi-word data at point.
Stefan Monnier [Tue, 9 Feb 2021 18:27:08 +0000 (13:27 -0500)]
Use lexical-binding in a few more scattered files
* lisp/registry.el: Use lexical-binding.
(registry-reindex): Remove unused var `values`.
* lisp/cedet/pulse.el: Use lexical-binding.
* lisp/cedet/semantic/idle.el: Use lexical-binding.
(semantic-idle-core-handler): Remove unused var `safe`.
(ede-auto-add-method): Declare var.
(define-semantic-idle-service): Use `declare`. Remove unused var `setup`.
(pulse-flag): Declare var.
* lisp/net/ldap.el: Use lexical-binding.
(ldap-search-internal): Remove unused var `proc`.
* lisp/net/mairix.el: Use lexical-binding.
Remove redundant `:group` args.
(mairix-widget-create-query): Remove unnused var `allwidgets`.
Juri Linkov [Tue, 9 Feb 2021 18:12:36 +0000 (20:12 +0200)]
New options read-char-by-name-sort and read-char-by-name-group (bug#46240)
* lisp/international/mule-cmds.el (mule--ucs-names-sort-by-code)
(mule--ucs-names-group): New functions.
(read-char-by-name-sort, read-char-by-name-group): New defcustoms.
(read-char-by-name): Use them.
Stefan Monnier [Tue, 9 Feb 2021 17:52:04 +0000 (12:52 -0500)]
* lisp/cedet/{semantic/scope.el,ede/project-am.el}: Use lexical-scoping
* lisp/cedet/ede/project-am.el: Remove redundant `:group` args.
(recentf-exclude): Declare variable.
(project-am--with-makefile-current): New function extracted from
`project-am-with-makefile-current`. Use `with-current-buffer` and
`unwind-protect`.
(project-am-with-makefile-current): Use `declare` and
`project-am--with-makefile-current`.
(project-am-with-config-current): Use `declare` and `with-temp-buffer`.
(project-am-extract-shell-variable): Turn it into a `defun`; the use of
`defmacro` appears to have been a plain mistake.
Stefan Monnier [Tue, 9 Feb 2021 17:10:07 +0000 (12:10 -0500)]
* lisp/emacs-lisp/byte-opt.el (byte-optimize--pcase): New macro
(byte-optimize-form-code-walker): Use it.
Stefan Monnier [Tue, 9 Feb 2021 17:02:25 +0000 (12:02 -0500)]
* lisp/emacs-lisp/macroexp.el: Break cycle with bytecomp/byte-opt
The recent change in macroexp triggered a cyclic dependency error
during eager macroexpansion when neither `bytecomp` nor `byte-opt` had
been byte-compiled yet. This fixes it by moving the offending
function to macroexp.el.
* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda): Move from
byte-opt.el and rename.
(macroexp--expand-all): Use it.
* lisp/emacs-lisp/byte-opt.el (byte-compile-unfold-lambda): Move to
macroexp.el.
(byte-compile-inline-expand, byte-optimize-form-code-walker):
* lisp/emacs-lisp/bytecomp.el (byte-compile-form):
Use `macroexp--unfold-lambda` instead.
Stefan Kangas [Tue, 9 Feb 2021 15:57:27 +0000 (16:57 +0100)]
Remove some dead, commented out code from lisp-mode.el
* lisp/emacs-lisp/lisp-mode.el (lisp-data-mode-syntax-table):
Remove code commented out since 2005.
Stefan Kangas [Tue, 9 Feb 2021 14:58:37 +0000 (15:58 +0100)]
Load all generic-x.el modes unconditionally
* lisp/generic-x.el: Load all modes unconditionally.
(generic-default-modes, generic-mswindows-modes)
(generic-unix-modes, generic-other-modes)
(generic-extras-enable-list): Make obsolete.
Ref: https://lists.gnu.org/r/emacs-devel/2021-01/msg01403.html
Lars Ingebrigtsen [Tue, 9 Feb 2021 15:28:30 +0000 (16:28 +0100)]
Note that the `values' variable is now obsolete
* src/lread.c (syms_of_lread): Note that it's obsolete in the doc
string (because we can't mark it as obsolete "properly" yet,
because that leads to compilation warnings when somebody
(let (values) ... values).
Basil L. Contovounesios [Tue, 9 Feb 2021 13:00:56 +0000 (13:00 +0000)]
; Fix recent change in eval-last-sexp
Basil L. Contovounesios [Tue, 9 Feb 2021 12:50:36 +0000 (12:50 +0000)]
; Finish customize-changed-options obsoletion
Alan Mackenzie [Tue, 9 Feb 2021 09:41:13 +0000 (09:41 +0000)]
Allow exit-minibuffer to be called from Lisp code. Fixes bug #46373
* lisp/minibuffer.el (exit-minibuffer): Throw the error "Not in most nested
minibuffer" only when the current buffer is a minibuffer (thus the command
came directly from a key binding).
* doc/lispref/minibuf.texi (Minibuffer Commands): Change the documentation
accordingly.
Lars Ingebrigtsen [Tue, 9 Feb 2021 08:20:11 +0000 (09:20 +0100)]
Make pcomplete-ignore-case obsolete
* lisp/pcomplete.el (pcomplete-completions-at-point)
(pcomplete-stub, pcomplete--entries, pcomplete-insert-entry):
* lisp/eshell/em-cmpl.el (eshell-cmpl-initialize):
* lisp/eshell/em-cmpl.el (eshell-cmpl-ignore-case):
* lisp/erc/erc-pcomplete.el (pcomplete-erc-setup): Use
`completion-ignore-case' instead (bug#23117).
* lisp/pcomplete.el (pcomplete-ignore-case): Make obsolete.
Matt Armstrong [Tue, 9 Feb 2021 08:10:45 +0000 (09:10 +0100)]
Preserve leading whitespace in `lm-commentary'.
* lisp/emacs-lisp/lisp-mnt.el (lm-commentary): Preserve leading
whitespace (bug#46364).
Lars Ingebrigtsen [Tue, 9 Feb 2021 08:04:47 +0000 (09:04 +0100)]
Move all usages of `values' to `values--store-value'
* lisp/simple.el (eval-expression):
* lisp/progmodes/elisp-mode.el (eval-last-sexp):
* lisp/emacs-lisp/pp.el (pp-eval-expression):
* lisp/emacs-lisp/edebug.el (edebug-eval-expression):
* lisp/emacs-lisp/pp.el (pp-eval-expression):
* lisp/emacs-lisp/edebug.el (edebug-eval-expression):
* lisp/cedet/data-debug.el (data-debug-eval-expression): Use it
instead of pushing to `values' directly (bug#22066).
* lisp/subr.el (values--store-value): New function.
Lars Ingebrigtsen [Tue, 9 Feb 2021 07:32:40 +0000 (08:32 +0100)]
Don't use `values' in elisp--eval-defun
* lisp/progmodes/elisp-mode.el (elisp--eval-defun): Don't use
`values', since it's being deprecated (bug#22066).
Lars Ingebrigtsen [Tue, 9 Feb 2021 07:20:08 +0000 (08:20 +0100)]
Finish customize-changed-options/customize-changed fix up
* doc/emacs/custom.texi (Specific Customization): Fix
customize-changed/customize-changed-options documentation.
* lisp/cus-dep.el (custom-make-dependencies): Adjust doc string
(bug#23085).
* lisp/menu-bar.el (menu-bar-custom-menu): Adjust menu options.
Lars Ingebrigtsen [Tue, 9 Feb 2021 07:12:10 +0000 (08:12 +0100)]
Fix count-lines problem in non-ASCII buffers
* src/fns.c (Fline_number_at_pos): Get the correct start position
in non-ASCII buffers (bug#22763).
Stefan Monnier [Tue, 9 Feb 2021 00:08:14 +0000 (19:08 -0500)]
* lisp/gnus/gnus-topic.el: Fix a backward incompatibility
(gnus-topic-insert-topic-line): Make the vars used in
`gnus-topic-line-format-spec` dynamically scoped since it seems
that they're sometimes accessed from functions called by
`gnus-topic-line-format-spec` :-(
* lisp/gnus/gnus-util.el (gnus--\,@): Move macro to here...
* lisp/gnus/gnus-art.el (gnus--\,@): .. from here.
* lisp/gnus/gnus.el (gnus-method-to-server): Apply DeMorgan.
Eric Abrahamsen [Mon, 8 Feb 2021 20:27:04 +0000 (12:27 -0800)]
Run Gnus group names through regexp-quote when matching results
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Be more
careful about making sure group names will match search results
correctly.
Eli Zaretskii [Mon, 8 Feb 2021 16:19:31 +0000 (18:19 +0200)]
; * etc/NEWS: Call out a recent change in Enriched mode.
Eli Zaretskii [Mon, 8 Feb 2021 16:04:00 +0000 (18:04 +0200)]
Fix scrolling past tall images
* src/xdisp.c (try_window): Don't try checking the margins if the
window is vscrolled, as that could cause unnecessary recentering
when tall images are displayed. (Bug#46320)
Stefan Monnier [Mon, 8 Feb 2021 14:18:41 +0000 (09:18 -0500)]
* lisp/indent.el (beginning-of-line-text): Mark it as a movement command
So that combining it with `shift` selects the text, as usual, in case
you have it bound for example to `C-a` in a mode like `enriched-mode`.
Stefan Kangas [Mon, 8 Feb 2021 08:03:27 +0000 (09:03 +0100)]
; Minor license statement fixes
Stefan Kangas [Mon, 8 Feb 2021 07:23:19 +0000 (08:23 +0100)]
* lisp/avoid.el: Doc fixes.
Lars Ingebrigtsen [Mon, 8 Feb 2021 07:15:45 +0000 (08:15 +0100)]
Record the value of `C-x C-e' in `values'
* lisp/progmodes/elisp-mode.el (eval-last-sexp): Record the value
in `values' (bug#22066) since we're messaging it.
Protesilaos Stavrou [Mon, 8 Feb 2021 06:54:54 +0000 (07:54 +0100)]
Add vc-dir faces; also apply them to vc-git
* etc/NEWS: Document the new faces.
* lisp/vc/vc-dir.el (vc-dir-header, vc-dir-header-value)
(vc-dir-directory, vc-dir-file, vc-dir-mark-indicator)
(vc-dir-status-warning, vc-dir-status-edited, vc-dir-status-up-to-date)
(vc-dir-ignored): Add new faces.
* lisp/vc/vc-git.el (vc-git-permissions-as-string, vc-git-dir-printer)
(vc-git-dir-extra-headers): Apply new faces (bug#46358).
Sean Whitton [Mon, 8 Feb 2021 06:52:16 +0000 (07:52 +0100)]
Bind clone-buffer to C-x x n
* lisp/bindings.el (ctl-x-x-map): Bind clone-buffer.
* etc/NEWS: Document the change (bug#46369).
Anticrisis [Mon, 8 Feb 2021 06:33:49 +0000 (07:33 +0100)]
Fix tcl-mode indentation of namespaced code
* lisp/progmodes/tcl.el (tcl-calculate-indent): Fix indentation
when using namespaces (bug#44834).
(tcl-beginning-of-defun-function): Remove. This partially reverts
cd5bb4bf3dbad8941d25823f398b595b8f0edbb9.
Copyright-paperwork-exempt: yes
Lars Ingebrigtsen [Mon, 8 Feb 2021 06:30:18 +0000 (07:30 +0100)]
Clarify "changes" in CONTRIBUTE
* CONTRIBUTE: Clarify that "changes" doesn't include removing code
(bug#44834).
Lars Ingebrigtsen [Mon, 8 Feb 2021 06:22:02 +0000 (07:22 +0100)]
Make `C-a' in enriched-mode behave more line in other modes
* lisp/textmodes/enriched.el (enriched-mode-map): Don't rebind
beginning-or-line, because it makes `C-S-a' not mark the region,
and it doesn't allow actually moving to the beginning of the line
if the line starts with characters in `adaptive-fill-regexp'
(bug#22554).
Lars Ingebrigtsen [Mon, 8 Feb 2021 06:11:52 +0000 (07:11 +0100)]
Fix noninteractive gnus-article-press-button
* lisp/gnus/gnus-art.el (gnus-article-press-button): Make the `b'
summary mode command work again.
Stefan Kangas [Sun, 7 Feb 2021 23:25:16 +0000 (00:25 +0100)]
Prefer setq-local in a few more places
* lisp/calc/calc-embed.el (calc-embedded-make-info):
* lisp/calc/calcalg2.el (calcFunc-integ):
* lisp/comint.el (comint-mode):
* lisp/epa.el (epa--list-keys, epa--show-key):
* lisp/epg.el (epg--start):
* lisp/vc/ediff-util.el (ediff-activate-mark): Prefer setq-local.
Stefan Kangas [Sun, 7 Feb 2021 23:24:11 +0000 (00:24 +0100)]
Add tests for count-lines
* test/lisp/simple-tests.el (simple-test-count-lines)
(simple-test-count-lines/ignore-invisible-lines): Add tests.
Eric Abrahamsen [Sun, 7 Feb 2021 21:46:50 +0000 (13:46 -0800)]
Fix namazu search result parsing in gnus-search
* lisp/gnus/gnus-search.el (gnus-search-indexed-extract): This method
is documented to leave point at the end of the extracted search
result. The namazu implementation wasn't doing that.
Michael Albinus [Sun, 7 Feb 2021 18:38:49 +0000 (19:38 +0100)]
; Rearrange changed entry in etc/NEWS
Lars Ingebrigtsen [Sun, 7 Feb 2021 16:29:57 +0000 (17:29 +0100)]
Use `line-number-at-pos' in `count-lines'
* lisp/simple.el (count-lines): Use `line-number-at-pos', which
should be faster.
Tino Calancha [Sun, 7 Feb 2021 15:51:07 +0000 (16:51 +0100)]
Add command to recenter errors from Occur/Grep buffers
To scroll up/down the current displayed occurrence/error
without abandon the Occur/Grep buffer.
Add also a command 'recenter-other-window' to recenter
the other window from any kind of buffer.
* lisp/window.el (recenter-other-window): New command.
Bind recenter-other-window to S-M-C-l (Bug#46119).
* lisp/simple.el (recenter-current-error): New command.
* lisp/progmodes/grep.el (grep-mode-map):
Delete bidings for n and p.
* lisp/progmodes/compile.el (compilation-minor-mode-map):
Move here the n and p bindings.
Bind `recenter-current-error' to l.
* lisp/replace.el (occur-mode-map):
Same.
* doc/emacs/windows.texi (Other Window):
* doc/emacs/display.texi (Recentering):
Document recenter-other-window.
* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
Announce the changes.
Lars Ingebrigtsen [Sun, 7 Feb 2021 15:42:25 +0000 (16:42 +0100)]
Allow Fline_number_at_pos being called with a marker
* src/fns.c (Fline_number_at_pos): Also allow being called with a
marker (since the Lisp function allowed that).
Lars Ingebrigtsen [Sun, 7 Feb 2021 15:28:30 +0000 (16:28 +0100)]
Move line-number-at-pos to C
* doc/lispref/positions.texi (Text Lines): Revert previous change.
* lisp/simple.el (line-number-at-pos): Remove definition.
* lisp/simple.el (count-lines): Revert back to using
`forward-line', because there seems to be a disagreement on how
lines should be counted in a region...
* src/fns.c (Fline_number_at_pos): Rename from
Fline_number_at_position and adjust parameter list.
Stefan Kangas [Sun, 7 Feb 2021 15:06:06 +0000 (16:06 +0100)]
Minor doc fixes in dictionary-connection.el
* lisp/net/dictionary-connection.el:
(dictionary-connection-p, dictionary-connection-read-to-point):
Minor doc fixes to adhere to our conventions.
Stefan Kangas [Sun, 7 Feb 2021 15:02:30 +0000 (16:02 +0100)]
Fix copyright and license statement in dictionary*.el
* lisp/net/dictionary-connection.el:
* lisp/net/dictionary.el: Add copyright statement and fix license
statement.
Lars Ingebrigtsen [Sun, 7 Feb 2021 15:02:56 +0000 (16:02 +0100)]
Add a new function 'line-number-at-position'
* doc/lispref/positions.texi (Text Lines): Document it.
* lisp/simple.el (count-lines): Use it.
(line-number-at-pos): Ditto.
* src/fns.c (Fline_number_at_position): New function (bug#22763).
Stefan Kangas [Sun, 7 Feb 2021 14:53:46 +0000 (15:53 +0100)]
Various doc fixes in dictionary.el
* lisp/net/dictionary.el (dictionary-set-server-var)
(dictionary-server, dictionary-port)
(dictionary-default-dictionary)
(dictionary-default-popup-strategy, dictionary-proxy-server)
(dictionary-proxy-port, dictionary-description-open-delimiter)
(dictionary-description-close-delimiter)
(dictionary-window-configuration, dictionary-selected-window)
(dictionary-position-stack, dictionary-data-stack)
(dictionary-positions, dictionary-current-data)
(dictionary-connection, dictionary-instances)
(dictionary-color-support, dictionary-word-history)
(dictionary-mode, dictionary, dictionary-check-connection)
(dictionary-mode-p, dictionary-send-command)
(dictionary-read-reply-and-split, dictionary-check-reply)
(dictionary-check-initial-reply, dictionary-store-state)
(dictionary-store-positions, dictionary-new-search)
(dictionary-new-search-internal, dictionary-do-search)
(dictionary-display-search-result)
(dictionary-display-word-definition)
(dictionary-special-dictionary, dictionary-set-strategy)
(dictionary-tooltip-dictionary, dictionary-switch-tooltip-mode)
(dictionary-tooltip-mode, global-dictionary-tooltip-mode): Doc fixes
to adhere to our conventions.
Lars Ingebrigtsen [Sun, 7 Feb 2021 14:12:15 +0000 (15:12 +0100)]
Revert "Fix inferior octave single-quote font lock"
This reverts commit
9e68413c7f0a7f71e1cee923ace7282d14c2e686.
This patch led to bug#46327:
x = [2 2]'
disp(x)
Which meant that the transpose operator was interpreted
as the start of a string.
Lars Ingebrigtsen [Sun, 7 Feb 2021 14:07:21 +0000 (15:07 +0100)]
Reverse customize-changed and customize-changed-options aliasing
* lisp/cus-edit.el (customize-changed): Rename from
customize-changed-options (bug#23085), since the old name doesn't
reflect what it does: It's not just about user options, but also
faces and the like.
(customize-changed-options): Make into an obsolete alias.
Lars Ingebrigtsen [Sun, 7 Feb 2021 13:47:09 +0000 (14:47 +0100)]
Clarify that #s(hash-table ...) doesn't always create a new hash table
* doc/lispref/hash.texi (Creating Hash): Note that the printed
representation doesn't necessarily create a new table (bug#23417).
* doc/lispref/lists.texi (Rearrangement): Link to Self-Evaluating
Forms to further expand upon immutability.
Lars Ingebrigtsen [Sun, 7 Feb 2021 12:53:44 +0000 (13:53 +0100)]
Add more commands to the new `C-x x' keymap
* doc/emacs/killing.texi (Accumulating Text):
* doc/emacs/display.texi (Line Truncation):
* doc/emacs/buffers.texi (Misc Buffer): Document it.
* lisp/bindings.el (ctl-x-x-map): Add new bindings for
rename-buffer, rename-uniquely, insert-buffer and
toggle-truncate-lines.
Sean Whitton [Sun, 7 Feb 2021 12:30:33 +0000 (13:30 +0100)]
Move 'revert-buffer' global binding to 'C-x g g'
* lisp/bindings.el: Define ctl-x-g-map and bind 'revert-buffer' to
'C-x x g' globally.
* doc/emacs/files.texi: Replace 'C-x g' with 'C-x x g'.
* etc/NEWS: Document the change (bug#46300).
Mattias Engdegård [Sun, 7 Feb 2021 11:24:40 +0000 (12:24 +0100)]
; * lisp/emacs-lisp/byte-opt.el: improved comment
Mattias Engdegård [Sun, 7 Feb 2021 09:35:36 +0000 (10:35 +0100)]
; Improved commentary in the variable constprop mechanism
* lisp/emacs-lisp/byte-opt.el (byte-optimize--lexvars)
(byte-optimize--vars-outside-condition)
(byte-optimize-form-code-walker, byte-optimize-let-form):
Clarify various aspects in the variable constant-propagation code,
as kindly pointed out by Stefan Monnier.
Dmitry Gutov [Sat, 6 Feb 2021 20:59:00 +0000 (22:59 +0200)]
Revert "Fix the previous change"
This reverts commit
fc37dc298f27025823fad2d944e11cc7ee6a058d.
That change was only needed in the release branch.
Mattias Engdegård [Thu, 4 Feb 2021 13:32:21 +0000 (14:32 +0100)]
Fix spurious warnings from unwise condition order in inlined code
These are both conditions having the form (and A B) where A is
side-effect-free and B may be known to be nil at compile time.
The compiler will then warn about A being useless and thrown away.
The fix is to test B first.
* lisp/gnus/gnus.el (gnus-method-to-server):
Test `(not no-enter-cache)` first.
(gnus-server-get-method): Test `group` first.
Mattias Engdegård [Sat, 6 Feb 2021 17:34:45 +0000 (18:34 +0100)]
Constprop of lexical variables
Lexical variables bound to a constant value (symbol, number or string)
are substituted at their point of use and the variable then eliminated
if possible. Example:
(let ((x (+ 2 3))) (f x)) => (f 5)
This reduces code size, eliminates stack operations, and enables
further optimisations. The implementation is conservative, and is
strongly curtailed by the presence of variable mutation, conditions
and loops.
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-enable-variable-constprop)
(byte-optimize-warn-eliminated-variable): New constants.
(byte-optimize--lexvars, byte-optimize--vars-outside-condition)
(byte-optimize--vars-outside-loop, byte-optimize--dynamic-vars):
New dynamic variables.
(byte-optimize--substitutable-p, byte-optimize-let-form):
New functions.
(byte-optimize-form-code-walker): Adapt clauses for variable
constprop, and add clauses for 'setq' and 'defvar'.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-var)
(bytecomp-test-get-var, bytecomp-test-identity)
(byte-opt-testsuite-arith-data): Add test cases.
Eli Zaretskii [Sat, 6 Feb 2021 18:50:57 +0000 (20:50 +0200)]
; Fix byte-compilation warning
* test/src/process-tests.el (process-sentinel-interrupt-event): Fix
byte compilation warning.
Eli Zaretskii [Sat, 6 Feb 2021 18:20:31 +0000 (20:20 +0200)]
; Fix last change
Ioannis Kappas [Wed, 3 Feb 2021 22:50:54 +0000 (22:50 +0000)]
New test for src/process.c on MS-Windows
* test/src/process-tests.el (process-sentinel-interrupt-event):
New test. (Bug#46284)
Copyright-paperwork-exempt: yes
Eric Abrahamsen [Sat, 6 Feb 2021 17:29:53 +0000 (09:29 -0800)]
Fix TEXT check in gnus-search IMAP search
* lisp/gnus/gnus-search.el (gnus-search-run-search): It's a string,
not a buffer!
Martin Rudalics [Sat, 6 Feb 2021 17:22:29 +0000 (18:22 +0100)]
Permit zero value for 'child-frame-border-width' parameter (Bug#46184)
* doc/lispref/frames.texi (Layout Parameters): Update entry on
'child-frame-border-width' parameter.
* src/frame.c (make_frame): Init child_frame_border_width to -1.
(Fframe_child_frame_border_width): Return internal border width if
child frame border width parameter is nil.
(gui_report_frame_params): Report nil as child frame border
width parameter if the frame value is negative.
* src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Return value of
child frame border width only if it is not negative.
* src/xfns.c (Fx_create_frame): Default child frame border to -1
when recording it in its frame slot via gui_default_parameter.
* src/nsfns.m (ns_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/w32fns.c (w32_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/xfns.c (x_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
Glenn Morris [Sat, 6 Feb 2021 16:10:38 +0000 (08:10 -0800)]
Merge from origin/emacs-27
8ad48a0bdd (origin/emacs-27) Improve doc string of 'text-scale-adjust'
7a25ff767d Clarify the indent-rigidly doc string
6c5ddf0e0b Fix two small tab bar issues
c71e08eba9 Fix last change in syntax.texi
# Conflicts:
# lisp/indent.el
Glenn Morris [Sat, 6 Feb 2021 16:05:30 +0000 (08:05 -0800)]
; Merge from origin/emacs-27
The following commit was skipped:
43bf7f1b06 Correct the lispref manual about flushing ppss info
Glenn Morris [Sat, 6 Feb 2021 16:05:29 +0000 (08:05 -0800)]
Merge from origin/emacs-27
8c27af3ff4 Clarify how transient indentation modes are exited in the ...
fc37dc298f Fix the previous change
Glenn Morris [Sat, 6 Feb 2021 16:05:29 +0000 (08:05 -0800)]
; Merge from origin/emacs-27
The following commits were skipped:
b99848c72c Bind default-directory to the project root
19534f988c Make sure default-directory relates to the originating buffer
d1455027e0 Initialize signal descriptions after pdumping
256356a36f Clarify the "Sentinels" node in the lispref manual
89f1634afc Fix problem with non-ASCII characters in nnmaildir
Lars Ingebrigtsen [Sat, 6 Feb 2021 14:04:52 +0000 (15:04 +0100)]
Fix previous change in testcover.el
* lisp/emacs-lisp/testcover.el
(testcover-analyze-coverage-edebug-after): The wrapper macro is
called `1value', not `testcover-1value'.
Eli Zaretskii [Sat, 6 Feb 2021 13:11:29 +0000 (15:11 +0200)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 6 Feb 2021 13:09:32 +0000 (15:09 +0200)]
Support file names with whitespace in Nroff mode
* lisp/textmodes/nroff-mode.el (nroff-view): Quote argument of
'Man-getpage-in-background' to support file names with special
characters. (Bug#46051)
Lars Ingebrigtsen [Sat, 6 Feb 2021 12:54:33 +0000 (13:54 +0100)]
Tweak provided-mode-derived-p doc string
* lisp/subr.el (provided-mode-derived-p): Remove detail about "or
their aliases", since that seems self-evident (bug#46331) (and
derived-mode-p works the same, and doesn't have the bit in
question).
Eli Zaretskii [Sat, 6 Feb 2021 12:31:51 +0000 (14:31 +0200)]
Improve doc string of 'text-scale-adjust'
* lisp/face-remap.el (text-scale-adjust): Clarify that "default
face height" refers to the 'default' face. (Bug#25168)